.class Lcom/xingbook/ting/fragment/d;
.super Landroid/os/Handler;


# instance fields
.field a:Ljava/lang/ref/WeakReference;


# direct methods
.method constructor <init>(Lcom/xingbook/ting/fragment/TingPlayBottomFragment;)V
    .locals 1

    invoke-direct {p0}, Landroid/os/Handler;-><init>()V

    const/4 v0, 0x0

    iput-object v0, p0, Lcom/xingbook/ting/fragment/d;->a:Ljava/lang/ref/WeakReference;

    new-instance v0, Ljava/lang/ref/WeakReference;

    invoke-direct {v0, p1}, Ljava/lang/ref/WeakReference;-><init>(Ljava/lang/Object;)V

    iput-object v0, p0, Lcom/xingbook/ting/fragment/d;->a:Ljava/lang/ref/WeakReference;

    return-void
.end method


# virtual methods
.method public handleMessage(Landroid/os/Message;)V
    .locals 7
    .annotation build Landroid/annotation/SuppressLint;
        value = {
            "ShowToast"
        }
    .end annotation

    const/4 v6, 0x1

    const/4 v2, 0x0

    invoke-super {p0, p1}, Landroid/os/Handler;->handleMessage(Landroid/os/Message;)V

    iget-object v0, p0, Lcom/xingbook/ting/fragment/d;->a:Ljava/lang/ref/WeakReference;

    invoke-virtual {v0}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/xingbook/ting/fragment/TingPlayBottomFragment;

    if-nez v0, :cond_1

    :cond_0
    :goto_0
    return-void

    :cond_1
    invoke-virtual {v0}, Lcom/xingbook/ting/fragment/TingPlayBottomFragment;->getActivity()Landroid/support/v4/app/FragmentActivity;

    move-result-object v1

    if-eqz v1, :cond_0

    iget v3, p1, Landroid/os/Message;->what:I

    packed-switch v3, :pswitch_data_0

    goto :goto_0

    :pswitch_0
    iget-object v2, p1, Landroid/os/Message;->obj:Ljava/lang/Object;

    if-nez v2, :cond_2

    invoke-virtual {v0}, Lcom/xingbook/ting/fragment/TingPlayBottomFragment;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    iget v2, p1, Landroid/os/Message;->arg2:I

    invoke-virtual {v0, v2}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v0

    :goto_1
    iget v2, p1, Landroid/os/Message;->arg1:I

    invoke-static {v1, v0, v2}, Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;

    move-result-object v0

    invoke-virtual {v0}, Landroid/widget/Toast;->show()V

    goto :goto_0

    :cond_2
    iget-object v0, p1, Landroid/os/Message;->obj:Ljava/lang/Object;

    check-cast v0, Ljava/lang/String;

    goto :goto_1

    :pswitch_1
    invoke-static {v1}, Lcom/xingbook/ting/play/j;->a(Landroid/content/Context;)Lcom/xingbook/ting/play/j;

    move-result-object v1

    invoke-virtual {v1}, Lcom/xingbook/ting/play/j;->g()Lcom/xingbook/audio/b/b;

    move-result-object v3

    if-eqz v3, :cond_3

    invoke-static {v0}, Lcom/xingbook/ting/fragment/TingPlayBottomFragment;->a(Lcom/xingbook/ting/fragment/TingPlayBottomFragment;)Landroid/widget/TextView;

    move-result-object v1

    invoke-virtual {v3}, Lcom/xingbook/audio/b/b;->ac()J

    move-result-wide v4

    invoke-static {v4, v5, v2, v6, v6}, Lcom/xingbook/c/i;->a(JZZZ)Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v1, v4}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    invoke-static {v0}, Lcom/xingbook/ting/fragment/TingPlayBottomFragment;->b(Lcom/xingbook/ting/fragment/TingPlayBottomFragment;)Landroid/widget/SeekBar;

    move-result-object v1

    invoke-virtual {v3}, Lcom/xingbook/audio/b/b;->ac()J

    move-result-wide v4

    long-to-int v4, v4

    invoke-virtual {v1, v4}, Landroid/widget/SeekBar;->setMax(I)V

    invoke-virtual {v0}, Lcom/xingbook/ting/fragment/TingPlayBottomFragment;->getActivity()Landroid/support/v4/app/FragmentActivity;

    move-result-object v1

    check-cast v1, Lcom/xingbook/ting/activity/TingPlayAct;

    invoke-virtual {v3}, Lcom/xingbook/audio/b/b;->u()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v1, v3, v2, v6}, Lcom/xingbook/ting/activity/TingPlayAct;->a(Ljava/lang/String;ZZ)V

    :cond_3
    :try_start_0
    sget-object v1, Lcom/xingbook/ting/play/MusicService;->s:Lcom/xingbook/ting/play/MusicService;

    if-eqz v1, :cond_4

    sget-object v1, Lcom/xingbook/ting/play/MusicService;->s:Lcom/xingbook/ting/play/MusicService;

    invoke-virtual {v1}, Lcom/xingbook/ting/play/MusicService;->n()Landroid/media/MediaPlayer;

    move-result-object v1

    if-eqz v1, :cond_4

    invoke-virtual {v1}, Landroid/media/MediaPlayer;->isPlaying()Z

    move-result v3

    if-eqz v3, :cond_4

    invoke-virtual {v1}, Landroid/media/MediaPlayer;->getCurrentPosition()I
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move-result v1

    :goto_2
    invoke-static {v0}, Lcom/xingbook/ting/fragment/TingPlayBottomFragment;->c(Lcom/xingbook/ting/fragment/TingPlayBottomFragment;)Landroid/widget/TextView;

    move-result-object v3

    int-to-long v4, v1

    invoke-static {v4, v5, v2, v6, v6}, Lcom/xingbook/c/i;->a(JZZZ)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v3, v2}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    invoke-static {v0}, Lcom/xingbook/ting/fragment/TingPlayBottomFragment;->b(Lcom/xingbook/ting/fragment/TingPlayBottomFragment;)Landroid/widget/SeekBar;

    move-result-object v0

    invoke-virtual {v0, v1}, Landroid/widget/SeekBar;->setProgress(I)V

    goto/16 :goto_0

    :catch_0
    move-exception v1

    move v1, v2

    goto :goto_2

    :cond_4
    move v1, v2

    goto :goto_2

    nop

    :pswitch_data_0
    .packed-switch 0x0
        :pswitch_0
        :pswitch_1
    .end packed-switch
.end method
